﻿import gs.TweenLite;
import mx.utils.Delegate;
class AS2.BoOver {
	var intID;
	function BoOver(btn:MovieClip, act, obj) {
		if (btn.real != null) {
			btn.hitArea = btn.real;
		}
		if (act.mode != 1) {
			btn.real._alpha = 0;
		}
		btn.useHandCursor=false;
		var scope = (act.scope == null) ? btn : act.scope;
		/*this.intID=setInterval(Delegate.create(this,function(){
			if(scope.hitTest( _xmouse,  _ymouse)){
				trace('aaa')
				act.over()
			}else{
				trace('bbb')
				act.out()
			}
		}),100) */
		//btn.onEnterFrame=null
		btn.onRollOver = (act.over == null) ? null : Delegate.create(scope, act.over);
		btn.onRollOut = btn.onReleaseOutside =(act.out == null) ? null : Delegate.create(scope, act.out);
		btn.onPress = (act.click == null) ? null : Delegate.create(scope, act.click); 

	}
	static function del(btn){
		delete btn.onRollOut;
		delete btn.onRollOver;
		delete btn.onRelease;
		delete btn.onReleaseOutside;
		delete btn.onPress;
	}
}